package y24.m3;

import java.util.Arrays;
import java.util.Scanner;

public class Test6 {
    public static void main(String[] args) throws InterruptedException {
        Scanner scanner = new Scanner(System.in);
        int[] num = new int[5];
        String ch = scanner.next();
        while (!"#".equals(ch)){
            switch (ch){
                case "a":
                    num[0]++;
                    break;
                case "b":
                    num[1]++;
                    break;
                case "c":
                    num[2]++;
                    break;
                case "d":
                    num[3]++;
                    break;
                default:
                    num[4]++;
                    break;
            }
            System.out.println(Arrays.toString(num));
            ch = scanner.next();
        }


    }
}
